package com.atguigu.tingshu.album.mapper;

import com.atguigu.tingshu.model.album.TrackInfo;
import com.atguigu.tingshu.query.album.TrackInfoQuery;
import com.atguigu.tingshu.vo.album.AlbumTrackListVo;
import com.atguigu.tingshu.vo.album.TrackListVo;
import com.atguigu.tingshu.vo.album.TrackStatVo;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

@Mapper
public interface TrackInfoMapper extends BaseMapper<TrackInfo> {

    /**
     * 查询声音的分页列表。
     * @param trackListVoPage
     * @param trackInfoQuery
     * @return
     */
    IPage<TrackListVo> selectUserTrackPage(Page<TrackListVo> trackListVoPage, @Param("vo") TrackInfoQuery trackInfoQuery);

    /**
     * 先根据专辑Id与分页条件获取到当前声音列表集合
     * @param albumId
     * @param page
     * @return
     */
    IPage<AlbumTrackListVo> selectAlbumTrackPage(Long albumId, Page<AlbumTrackListVo> page);

    /**
     * 更新声音播放量
     * @param trackId
     * @param statType
     * @param count
     */
    void updateStat(@Param("trackId") Long trackId, @Param("statType") String statType, @Param("count") Integer count);

    /**
     * 获取统计书籍
     * @param trackId
     * @return
     */
    TrackStatVo selectTrackStat(@Param("trackId") Long trackId);

}
